<template>
  <div id="progress">
    <el-row type="flex" class="" justify="center">
      <el-col :span="23" class="line">
        <i class="el-icon-time"></i>评审结果
      </el-col>
    </el-row>
    <div class="content" v-loading.fullscreen.lock="fullscreenLoading"
              element-loading-text="拼命加载中"
    element-loading-spinner="el-icon-loading"
    element-loading-background="rgba(0, 0, 0, 0.2)">
      <el-card class="box-card">
        <el-table
          :data="tableData"
          stripe
          style="width: 100%">
          <el-table-column
            prop="type"
            label="报考项目"
            align="center">
          </el-table-column>
          <el-table-column
            prop="create_time"
            label="报名时间"
            align="center">
          </el-table-column>
          <el-table-column
            prop="status"
            label="状态"
            align="center">
          </el-table-column>
          <el-table-column
            label="操作"
            align="center">
            <template slot-scope="scope">
               <el-button type="primary" size="mini" @click="gotoDetail(scope.row)">查看详情</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-card>
     </div>
  </div>
</template>

<script>
  import VDistpicker from 'v-distpicker'
  export default {

    data() {
      return {
        value:'',
        fullscreenLoading:false,
        tableData: []
        
      }
    },
    components: {
      VDistpicker
    },
    mounted(){
      //this.fullscreenLoading=true;
      //this.getInfo();
    },
    methods: {
      getInfo(){
        var that=this;
        this.axios({
          url:this.host+'/3v1t.smserver.cn/index.php/index/student.Progress/all_entry',
          method:'post',
          headers:{
                "Content-type":"application/json"
          }
        }).then((res)=>{
          console.log(res);
          that.fullscreenLoading=false;
          var data=res.data.data;
          data.forEach((item)=>{
            if(item.type=="01"){
              item.type="三位一体"
            }else{
              item.type="高水平运动员"
            }
            item.status=item.status.name;
          })
          that.tableData=data;
        })
      },
      gotoDetail(mess){
        this.$router.push({
            path: '/userHome/progressDetail', 
            query: { id: mess.id}
            /*query: {
                name: 'name', 
                dataObj: this.msg
            }*/
        })
        //this.$router.push('/userHome/progressDetail')
      },
      changeTable(data){
        console.log(data);
        var that=this;
        if(data=="三位一体"){
          this.axios({
            url:this.host+'/3v1t.smserver.cn/index.php/index/student.Progress/all_entry',
            method:'post',
            headers:{
                  "Content-type":"application/json"
            }
          }).then((res)=>{
            console.log(res);
            if(res.data.code==2){
              that.$message({
                type:'warning',
                message:''+res.data.msg
              })
            } 
          })
        }else if(data=="高水平运动员"){
          this.axios({
            url:this.host+'/3v1t.smserver.cn/index.php/index/student.Download/pdf_zxs',
            method:'post',
            headers:{
                  "Content-type":"application/json"
            }
          }).then((res)=>{
            console.log(res);
            if(res.data.code==2){
              that.$message({
                type:'warning',
                message:''+res.data.msg
              })
            }   
          })
        }
      }
    }
  }

</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss">
  #progress {
    //width:100%;
    //line-height:100%;
    padding: 10px;
    .line {
      border-bottom: 1px solid #ccc;
      text-align: left;
      height: 50px;
      line-height: 50px;
      padding-left: 10px;
    }
    .content {
      padding: 20px;
      text-align: center;
    }
    .download{
      float:right;
      width:130px;
      margin:0 20px;
    }
    
  }

</style>
